Skip to content

refactor: align with reflexio's window_size/stride_size config rename#12

Merged
yyiilluu merged 2 commits intomainfrom
refactor/window-stride-rename
May 5, 2026
Merged

refactor: align with reflexio's window_size/stride_size config rename#12
yyiilluu merged 2 commits intomainfrom
refactor/window-stride-rename

Conversation

@yyiilluu
Copy link
Copy Markdown
Contributor

@yyiilluu yyiilluu commented May 5, 2026

Summary

  • Reflexio 0.2.20 renamed Config.batch_size / batch_intervalwindow_size / stride_size (the old names remain as deprecated aliases).
  • Bump the plugin's reflexio-ai floor to >=0.2.20 and rename every reference (dashboard form + types, SessionStart hook constants, adapter call site, tests) to the canonical names.
  • Rename Adapter.apply_batch_defaultsAdapter.apply_extraction_defaults so the method name no longer suggests a batch-processing semantics that doesn't exist anymore.
  • Refresh the dashboard screenshots and tighten the README "stop repeating mistakes" example.
  • Add a Discord community badge to the README (https://discord.gg/Jbft3jPn).
  • Drop the obsolete /smart-sync reference from dashboard empty-state copy — there is no such command; extraction is automatic.

Changes

Plugin runtime

  • plugin/pyproject.toml — pin reflexio-ai>=0.2.20.
  • plugin/uv.lock — re-resolved against PyPI 0.2.20.
  • plugin/src/claude_smart/reflexio_adapter.py — rename apply_batch_defaultsapply_extraction_defaults; reads/writes config.window_size / config.stride_size.
  • plugin/src/claude_smart/events/session_start.py — constants renamed to _CLAUDE_SMART_WINDOW_SIZE / _CLAUDE_SMART_STRIDE_SIZE; updated call site and comment.

Dashboard

  • plugin/dashboard/lib/types.ts — swap batch_size / batch_interval for window_size / stride_size on ReflexioConfig.
  • plugin/dashboard/app/configure/server/page.tsx — bind the two number inputs to the renamed fields.
  • plugin/dashboard/app/{dashboard,playbooks,profiles}/page.tsx — empty-state copy no longer references the non-existent /smart-sync command; explains that extraction happens automatically as you keep using Claude.

Submodule + assets

  • reflexio — bump to commit b8ac1b0 (the rename commit, version 0.2.20).
  • assets/playbook_dashboard.png, assets/profile_dashboard.png — refreshed screenshots.

Docs

  • README.md — replace the "Stop repeating the same mistakes" example with a transferable major-version-bump scenario; add a Discord badge linking to the community server.

Tests

  • tests/test_adapter.py — update _ConfigClient and the four apply_extraction_defaults_* tests to the new field/method names.
  • tests/test_events.py — rename test_session_start_applies_claude_smart_extraction_defaults and the matching stub method; assertion now reads {"window_size": 5, "stride_size": 3}.

Test Plan

  • uv run pytest tests/test_adapter.py tests/test_events.py -k "extraction_defaults or session_start_applies" → 5 passed.
  • uv run ruff check on changed Python files → clean.
  • uv run pyright on changed Python files → 0 errors.
  • npx tsc --noEmit and npx biome check on changed dashboard files → clean.
  • Manually verify the dashboard's "Reflexio server" page round-trips window_size / stride_size against a running reflexio 0.2.20 backend (steady-state SessionStart should be a single GET; only the first SessionStart against a fresh server triggers a set_config).
  • Visually confirm the Discord badge renders in the README header on GitHub and links to https://discord.gg/Jbft3jPn.

Summary by CodeRabbit

  • Documentation

    • Updated README example demonstrating extraction configuration best practices.
  • Refactor

    • Configuration parameters updated to use extraction window-size and stride-size instead of batch-based settings.
  • Dependencies

    • Backend dependency version updated to latest compatible release.

Reflexio renamed Config.batch_size/batch_interval to window_size/stride_size
in 0.2.20. Track that rename in the plugin: bump the floor to >=0.2.20, mirror
the field names in the dashboard form + types, in the SessionStart hook
constants, in the adapter call site, and in tests. Rename the adapter method
to apply_extraction_defaults to match the new semantics. Reflexio still
exposes the old field names as deprecated aliases, so existing servers are
unaffected at the wire level.

Also refresh the dashboard screenshots and tighten the README "stop repeating
mistakes" example.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

📝 Walkthrough

Walkthrough

The PR replaces the batch-based configuration model (batch_size, batch_interval) with an extraction-based model (window_size, stride_size) across the UI, types, adapter logic, and tests, and bumps the reflexio-ai dependency to support these new fields.

Changes

Configuration Model Refactoring: Batch → Extraction

Layer / File(s) Summary
Data Shape & Dependencies
plugin/dashboard/lib/types.ts, plugin/pyproject.toml
ReflexioConfig interface fields changed from batch_size/batch_interval to window_size/stride_size. Dependency reflexio-ai bumped from >=0.2.15 to >=0.2.20.
Core Adapter Implementation
plugin/src/claude_smart/reflexio_adapter.py
Method apply_batch_defaults(batch_size, batch_interval) replaced with apply_extraction_defaults(window_size, stride_size). New method reads config, checks field match, updates and persists if needed, returns True on success or False on client unavailability/exception.
Event Handler & Constants
plugin/src/claude_smart/events/session_start.py
Added module-level constants _CLAUDE_SMART_WINDOW_SIZE = 5 and _CLAUDE_SMART_STRIDE_SIZE = 3. Updated adapter initialization call to use apply_extraction_defaults(...) with new constants.
UI Configuration Page
plugin/dashboard/app/configure/server/page.tsx
"Extraction window size" input binding changed from batch_size to window_size; "Extraction stride" input binding changed from batch_interval to stride_size.
Subproject Commit
reflexio
Updated reflexio submodule pointer from 9da73f80... to b8ac1b0e....
Tests & Documentation
tests/test_adapter.py, tests/test_events.py, README.md
Test fixtures and test cases renamed/updated (apply_batch_defaults_*apply_extraction_defaults_*). Event tests updated to assert extraction defaults of {"window_size": 5, "stride_size": 3}. README example updated from npm watch-mode hang to prisma major-version break, illustrating "treat major ORM/DB driver upgrades as breaking."

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • ReflexioAI/claude-smart#11: Updates the same Adapter class with profile-search method changes; verify compatibility if merging in sequence.

Poem

🐰 A rabbit hops through batch and stride,
From old defaults, we step aside,
Window-size and stride now gleam,
Extraction flows—a cleaner dream,
Reflexio bumped, tests aligned,
Configuration redesigned!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 19.05% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: a refactor aligning the codebase with reflexio's config field rename from batch_size/batch_interval to window_size/stride_size.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/window-stride-rename

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@reflexio`:
- Line 1: The repository's git submodule is pointing at an unreleased commit
b8ac1b0e92b703f3776b93a9f4d240b332d7981e (post-release) while the project claims
reflexio v0.2.20 (tag 9da73f80) and dependency pin reflexio-ai>=0.2.20; fix by
either updating the submodule to the official release commit (reset the
submodule to tag 9da73f80) or, if the newer commit is intentional, update the
dependency declaration and documentation to reference the unreleased commit/SHA
and adjust the version pin (e.g., require reflexio-ai>=0.2.21 or a git+ssh URL
to that SHA) so the stated dependency and the submodule SHA are consistent.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1529381c-dda3-4218-b847-8cac53ae3fbc

📥 Commits

Reviewing files that changed from the base of the PR and between d66ba1e and 04d07ca.

⛔ Files ignored due to path filters (3)
  • assets/playbook_dashboard.png is excluded by !**/*.png
  • assets/profile_dashboard.png is excluded by !**/*.png
  • plugin/uv.lock is excluded by !**/*.lock
📒 Files selected for processing (9)
  • README.md
  • plugin/dashboard/app/configure/server/page.tsx
  • plugin/dashboard/lib/types.ts
  • plugin/pyproject.toml
  • plugin/src/claude_smart/events/session_start.py
  • plugin/src/claude_smart/reflexio_adapter.py
  • reflexio
  • tests/test_adapter.py
  • tests/test_events.py

Comment thread reflexio
@@ -1 +1 @@
Subproject commit 9da73f80456365abc6f756b3742059d4e50b019d
Subproject commit b8ac1b0e92b703f3776b93a9f4d240b332d7981e
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Confirm the submodule commit exists upstream and matches the 0.2.20 release tag.
set -e

# Show the configured submodule URL
cat .gitmodules || true

SHA="b8ac1b0e92b703f3776b93a9f4d240b332d7981e"

# Try to resolve via GitHub API (no clone needed) against the likely upstream repo.
echo "--- Commit metadata ---"
gh api "repos/ReflexioAI/reflexio/commits/${SHA}" \
  --jq '{sha, message: .commit.message, author: .commit.author.name, date: .commit.author.date}' || true

echo "--- Tags pointing at this commit ---"
gh api "repos/ReflexioAI/reflexio/git/refs/tags" \
  --jq '.[] | select(.object.sha=="'"${SHA}"'") | .ref' || true

echo "--- Release named 0.2.20 (if any) ---"
gh api "repos/ReflexioAI/reflexio/releases/tags/0.2.20" \
  --jq '{tag_name, target_commitish, name, published_at}' || true

Repository: ReflexioAI/claude-smart

Length of output: 2370


🏁 Script executed:

#!/bin/bash
# Check all recent releases and tags in reflexio repo to understand versioning

echo "=== Recent releases ==="
gh api "repos/ReflexioAI/reflexio/releases" \
  --jq '.[] | {tag_name, name, published_at, draft, prerelease}' \
  --paginate | head -20 || true

echo ""
echo "=== Recent tags ==="
gh api "repos/ReflexioAI/reflexio/git/refs/tags" \
  --jq '.[] | .ref' \
  --paginate | head -20 || true

echo ""
echo "=== Verify if commit is on main/default branch ==="
SHA="b8ac1b0e92b703f3776b93a9f4d240b332d7981e"
gh api "repos/ReflexioAI/reflexio/commits/${SHA}" \
  --jq '.commit.message[:100]' && echo "Commit verified in repo" || true

Repository: ReflexioAI/claude-smart

Length of output: 415


🏁 Script executed:

#!/bin/bash
# Verify v0.2.20 tag points to the correct commit

SHA="b8ac1b0e92b703f3776b93a9f4d240b332d7981e"

echo "=== v0.2.20 tag details ==="
gh api "repos/ReflexioAI/reflexio/git/refs/tags/v0.2.20" \
  --jq '.object' || true

echo ""
echo "=== All tags with their commit SHAs ==="
gh api "repos/ReflexioAI/reflexio/git/refs/tags" \
  --jq '.[] | select(.ref | contains("v0.2")) | {ref, sha: .object.sha}' \
  --paginate || true

Repository: ReflexioAI/claude-smart

Length of output: 787


🏁 Script executed:

#!/bin/bash
# Get the commit that v0.2.20 tag points to

TAG_OBJECT_SHA="ecfb1682942aa3cacf077f896569f97b8bff73ea"
EXPECTED_COMMIT="b8ac1b0e92b703f3776b93a9f4d240b332d7981e"

echo "=== Tag object details (to find target commit) ==="
gh api "repos/ReflexioAI/reflexio/git/tags/${TAG_OBJECT_SHA}" \
  --jq '{tagger: .tagger.name, message: .message[:200], object: .object}' || true

echo ""
echo "=== Alternative: Get v0.2.20 tag dereferenced to commit ==="
gh api "repos/ReflexioAI/reflexio/commits/v0.2.20" \
  --jq '.sha' || true

echo ""
echo "Expected submodule commit: ${EXPECTED_COMMIT}"

Repository: ReflexioAI/claude-smart

Length of output: 524


🏁 Script executed:

#!/bin/bash
# Check if submodule commit is a descendant of v0.2.20 or unrelated

SUBMODULE_COMMIT="b8ac1b0e92b703f3776b93a9f4d240b332d7981e"
V0220_COMMIT="9da73f80456365abc6f756b3742059d4e50b019d"

echo "=== Submodule commit details ==="
gh api "repos/ReflexioAI/reflexio/commits/${SUBMODULE_COMMIT}" \
  --jq '{sha, date: .commit.author.date, message: .commit.message[:150]}' || true

echo ""
echo "=== v0.2.20 release commit details ==="
gh api "repos/ReflexioAI/reflexio/commits/${V0220_COMMIT}" \
  --jq '{sha, date: .commit.author.date, message: .commit.message[:150]}' || true

echo ""
echo "=== Check if submodule commit is reachable from main/default branch ==="
gh api "repos/ReflexioAI/reflexio" \
  --jq '.default_branch' || true

echo ""
echo "=== Commits since v0.2.20 (latest on default branch) ==="
gh api "repos/ReflexioAI/reflexio/commits" \
  --jq '.[] | {sha, message: .commit.message[:80]}' \
  --paginate | head -10 || true

Repository: ReflexioAI/claude-smart

Length of output: 1834


Submodule commit does not match reflexio 0.2.20 release—points to unreleased code instead.

The submodule SHA b8ac1b0e92b703f3776b93a9f4d240b332d7981e (dated 2026-05-04, PR #41: rename batch_size → window_size) is committed AFTER the v0.2.20 release tag 9da73f80 (dated 2026-05-03). This creates a critical mismatch: the PR claims alignment with reflexio 0.2.20, and the dependency pin specifies reflexio-ai>=0.2.20, but the submodule actually points to unreleased post-0.2.20 code. Either pin the submodule to the actual v0.2.20 release commit, or clarify that an unreleased version is intentional and ensure dependency pins reflect this.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@reflexio` at line 1, The repository's git submodule is pointing at an
unreleased commit b8ac1b0e92b703f3776b93a9f4d240b332d7981e (post-release) while
the project claims reflexio v0.2.20 (tag 9da73f80) and dependency pin
reflexio-ai>=0.2.20; fix by either updating the submodule to the official
release commit (reset the submodule to tag 9da73f80) or, if the newer commit is
intentional, update the dependency declaration and documentation to reference
the unreleased commit/SHA and adjust the version pin (e.g., require
reflexio-ai>=0.2.21 or a git+ssh URL to that SHA) so the stated dependency and
the submodule SHA are consistent.

- README: link join URL https://discord.gg/Jbft3jPn with a Discord-branded shields.io badge.
- Dashboard/Playbooks/Profiles empty states: drop the obsolete `/smart-sync` reference (no such command) and explain that extraction happens automatically as you keep using Claude.
@yyiilluu yyiilluu merged commit 0d2f3e5 into main May 5, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant